<template>
	<view class="c-container">
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.contract_no">
				<view class="col-title">合同编号</view>
				<view class="col-text">{{ orderInfo.contract_no }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">订单类型</view>
				<view class="col-text">{{ orderInfo.news_type }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.company_id > 0">
				<view class="col-title">签约公司</view>
				<view class="col-text">{{ orderInfo.company }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">销售</view>
				<view class="col-text">{{ orderInfo.username }}</view>
			</view>
			<view class="c-row-col" v-if="orderInfo.cooperation_mode">
				<view class="col-title">合作模式</view>
				<view class="col-text">{{ orderInfo.cooperation_mode }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.hotel">
				<view class="col-title">举办酒店</view>
				<view class="col-text">{{ orderInfo.hotel }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.hall && orderInfo.hall.length > 0">
				<view class="col-title">宴会厅</view>
				<view class="col-text"><van-tag type="success" :key="item.id" v-for="item in orderInfo.hall">{{item.title}}</van-tag></view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.banquet_type && orderInfo.banquet_type.length > 0">
				<view class="col-title">宴会类型</view>
				<view class="col-text">{{dictionary.convertBanquetTypeToStr(orderInfo.banquet_type)}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">订单渠道</view>
				<view class="col-text">{{ orderInfo.source_text }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">举办时间</view>
				<view class="col-text">{{ orderInfo.event_date }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">签单时间</view>
				<view class="col-text">{{ orderInfo.sign_date }}</view>
			</view>
		</view>
		<view class="line"></view>
		<view class="c-row">
			<view class="c-row-col" v-if="babyInfo.table_price > 0">
				<view class="col-title">餐标</view>
				<view class="col-text">{{ babyInfo.table_price }}</view>
			</view>
			<view class="c-row-col" v-if="babyInfo.table_amount > 0">
				<view class="col-title">桌数</view>
				<view class="col-text">{{ babyInfo.table_amount }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="babyInfo.food_totals > 0">
				<view class="col-title">餐饮总价</view>
				<view class="col-text">{{ babyInfo.food_totals }}</view>
			</view>
			<view class="c-row-col" v-if="babyInfo.arrangement > 0">
				<view class="col-title">布置费用</view>
				<view class="col-text">{{ babyInfo.arrangement }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">订单总额</view>
				<view class="col-text">{{ orderInfo.totals }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">订单性质</view>
				<view class="col-text">{{ orderInfo.complete==99 ? '意向金订单' : orderInfo.complete == 98 ? '定金订单' : '订单'}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">联系人</view>
				<view class="col-text">{{ orderInfo.bridegroom }}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">联系电话</view>
				<view class="col-text">{{ orderInfo.bridegroom_mobile }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.remark">
				<view class="col-title">备注</view>
				<view class="col-remark">{{ orderInfo.remark }}</view>
			</view>
		</view>
		<view class="c-row" v-if="orderInfo.images">
			<view class="c-row-col">
				<view class="col-title">合同照片</view>
				<view class="col-text">
					<image
						class="col-img"
						v-for="(img, imgIndex) in orderInfo.images"
						:key="imgIndex"
						:src="img"
						@click="previewImg({ list: orderInfo.images, index: imgIndex })"
					></image>
				</view>
			</view>
		</view>
		<view class="c-row" v-if="orderInfo.addons && orderInfo.addons.length > 0">
			<view class="c-row-col">
				<view class="col-title">订单增项</view>
				<view class="col-text">
					<!-- 其他费用列表 -->
					<view class="c-row-box" v-if="orderInfo.addons && orderInfo.addons.length > 0">
						<!-- <view class="c-row-head">
							<view class="c-row-title">增项列表</view>
						</view> -->
						<view class="panel-body">
							<view class="other-list">
								<view class="row" style="padding: 0 8px;">
									<view class="col"><view>增项类型</view></view>
									<view class="col"><view>增项数量</view></view>
									<view class="col"><view>增项价格</view></view>
									<view class="col"><view>增项小计</view></view>
									<!-- <view class="col">
										<view>备注</view>
									</view> -->
								</view>
								<view class="row" v-for="(item, index) in orderInfo.addons" :key="index">
									<view class="col">
										<view class="col-item-text">
											<template v-if="item.ritual_id > 0">
												{{ dictionary.getPickerTitle('ritualList', item.ritual_id) }}
											</template>
											<template>
												{{ item.title }}
											</template>
										</view>
									</view>
									<view class="col">
										<view>{{ item.amount }}</view>
									</view>
									<view class="col">
										<view>{{ item.price }}</view>
									</view>
									<view class="col">
										<view>{{ item.total }}</view>
									</view>
									<!-- <view class="col">
										<view>{{item.remark}}</view>
									</view> -->
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import dictionary from '@/utils/dictionary.js';
export default {
	name: 'cDetail',
	props: {
		babyInfo: {
			type: Object,
			default() {
				return {};
			}
		},
		orderInfo: {
			type: Object,
			default() {
				return {};
			}
		}
	},
	data() {
		return {};
	},
	beforeMount() {
		this.dictionary = dictionary;
	},
	methods: {
		// 预览图片
		previewImg(data) {
			uni.previewImage({
				urls: data.list,
				current: data.index
			});
		}
	}
};
</script>

<style lang="less">
@import url('../common.less');
	.c-container .van-tag{
		margin-right: 5px !important;
	}
</style>
